package com.berje.vkalarm;

import android.content.Context;
import android.content.SharedPreferences;
import android.content.SharedPreferences.Editor;
import android.preference.PreferenceManager;

public class Account {
	private String access_token;
	private long user_id;
	private long alarm_gid;

	public void save(Context context) {
		SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
		Editor editor = prefs.edit();
		editor.putString("access_token", access_token);
		editor.putLong("user_id", user_id);
		editor.putLong("alarm_gid", alarm_gid);

		editor.commit();
	}

	public void restore(Context context) {
		SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
		access_token = prefs.getString("access_token", null);
		user_id = prefs.getLong("user_id", 0);
		alarm_gid = prefs.getLong("alarm_gid", 0);
	}

	public String getAccess_token() {
		return access_token;
	}

	public long getUser_id() {
		return user_id;
	}

	public void setAccess_token(String access_token) {
		this.access_token = access_token;
	}

	public void setUser_id(long user_id) {
		this.user_id = user_id;
	}

	public long getAlarm_gid() {
		return alarm_gid;
	}

	public void setAlarm_gid(long alarm_gid) {
		this.alarm_gid = alarm_gid;
	}

}
